import request from '@/utils/request';

export interface TaskTrackListType {
  // 已审核照片错误数
  auditErrorImage: number;
  // 已审核照片数
  auditImage: number;
  // 已审核正常照片数
  auditNormalImage: number;
  // 一线审核人
  auditors: string;
  // 申诉审核人
  complaintAudit: string;
  // 申诉照片数
  complaintImage: number;
  // 申诉结果
  complaintResult: string;
  // 抽检总数
  imageTotal: number;
  status: number;
  taskCompletionTime: string;
  taskId: string;
  taskName: string;
  // 执行进度
  taskProgress: string;
  taskStartTime: string;
}

export interface TaskTrackListDto {
  list: TaskTrackListType[];
  pageNo: number;
  pageSize: number;
  totalNumber: number;
  totalPage: number;
}
export interface TaskListType {
  // 已审核总条数
  auditCompleteTotal: number;
  // 当前条数
  nowPageTotal: number;
  // 待审核条数
  waitAuditCompleteTotal: number;
  // 失效时间差
  distanceDate: number;
  // 截止时间
  auditEndTime: string;
  // 审核总条数
  auditTotal: number;
  id: number;
  // 照片ai标签
  imageAiMarks: string;
  imageUrl: string;
  // 抽检审核单号
  auditNo: string;
  taskId: string;
  taskTypeCode: string;
  taskTypeName: string;
}
export interface TaskListDto {
  pageNo: number;
  pageSize: number;
  taskList: TaskListType[];
  totalNumber: number;
  totalPage: number;
}

export interface ComplaintAuditTypeList {
  // 已审核总条数
  auditCompleteTotal: number;
  // 当前条数
  nowPageTotal: number;
  // 审核单号
  auditNo: string;
  // 审核总条数
  auditTotal: number;
  // 待审核条数
  waitAuditCompleteTotal: number;
  // 驳回理由
  complaintAuditReject: string;
  // 申诉单号
  complaintNo: string;
  complaintReason: string;
  complaintResult: number;
  // 核查判断类型
  complaintType: string;
  // 照片AI标签
  imageAiMarksName: string;
  id: number;
  imageAiMarks: string;
  imageTotal: number;
  imageUrl: string;
  taskId: string;
  taskTypeCode: string;
  taskTypeName: string;
  // 申诉状态
  complaintStatus: number;
}
export interface ComplaintAuditDto {
  grievanceList: ComplaintAuditTypeList[];
  pageNo: number;
  pageSize: number;
  totalNumber: number;
  totalPage: number;
}
interface TaskUpdateType {
  // 判断类型
  complaintType: number;
  imageId: number;
  remark: string;
  // 抽检审核id
  samplingAuditId: string;
  status: number;
  taskId: string;
  id: number;
}
interface ComplaintAuditParamsType {
  auditStatus: number;
  imageId: number;
  rejectionReason: string;
}
interface TaskListSelectType {
  imageTotal: number;
  randomInspectionTaskId: string;
  randomInspectionTaskName: string;
}
export default {
  /**
   * 抽检任务追踪
   * @param params
   * @returns
   */
  async taskTrackList(params) {
    const res = await request.doPost<TaskTrackListDto>(
      '/abi-cloud-beesforce-inspection-service/samplingAudit/taskTrackList',
      params,
    );
    return {
      // list: res?.data?.list,
      list: [{ id: 111 }],
      total: res?.data?.totalNumber,
    };
  },

  /**
   * 认领任务
   * @param params
   * @returns
   */
  adoptTask(params) {
    return request.doPost<{ result: string; status: boolean }>(
      '/abi-cloud-beesforce-inspection-service/samplingAudit/adoptTask',
      params,
    );
  },
};
